package emby.lang;

import java.io.Serializable;

import emby.err.RuntimeError;
import emby.overload.OverloadDot;

/**
 * Represents null for emby.
 * Java's null should never naturally exist within an emby environment.
 * @author Justin
 *
 */
public class EmbyNull extends EmbyObject implements Serializable, OverloadDot{

	private static final long serialVersionUID = 7644461633187196126L;
	public static EmbyNull Null = new EmbyNull();

	private EmbyNull(){
	}

	public String toString(){
		return "null";
	}

	@Override
	public Object get_dot(int line, String attribute) {
		// TODO Auto-generated method stub
		if( attribute.equals("jnull")){
			return null;
		}
		throw new RuntimeError(line, "null does not have attribute: "+attribute);
	}

	@Override
	public void set_dot(int line, String attribute, Object new_value) {
		throw new RuntimeError(line, "null does not have any attributes to set");
	}
}
